<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ts_categoryattr.*" %>
<%@page import="com.lmpop.trade.ts_category.Ts_categoryInfo" %>
<%@page import="java.util.*" %>
<html>
  <head>
    
    <title>ts_categoryattr Manager</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="/program/admin/js/judgment.js" charset="UTF-8"></script>
</head>

<body>

  <% 
  	
  	  	
  	  Ts_categoryInfo ts_categoryInfo  = new Ts_categoryInfo ();
	
			String cat_id="";
			if (request.getParameter("cat_id") != null){
				cat_id = request.getParameter("cat_id");
			}
			
			String cat_name =ts_categoryInfo.getCatNameById(cat_id);
			String up_cat_id="";
			if (request.getParameter("up_cat_id") != null){
				up_cat_id = request.getParameter("up_cat_id");
			}
  	
  	String attr_id="";
  	if(request.getParameter("attr_id")!=null) attr_id = request.getParameter("attr_id");

  	Ts_categoryattrInfo ts_categoryattrInfo = new Ts_categoryattrInfo();
  	List list = ts_categoryattrInfo.getListByPk(attr_id);
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
  	String class_id="",attr_name="",attr_no="",default_tag="",default_value="",en_name="",enable_tag="",con_type="";
  	if(map.get("class_id")!=null) class_id = map.get("class_id").toString();
  	if(map.get("attr_name")!=null) attr_name = map.get("attr_name").toString();
  	if(map.get("attr_no")!=null) attr_no = map.get("attr_no").toString();
  	if(map.get("default_tag")!=null) default_tag = map.get("default_tag").toString();
  	if(map.get("default_value")!=null) default_value = map.get("default_value").toString();
  	if(map.get("enable_tag")!=null) enable_tag = map.get("enable_tag").toString();
  	if(map.get("con_type")!=null) con_type = map.get("con_type").toString();
	if(map.get("en_name")!=null) en_name = map.get("en_name").toString();

  %>
	
	<h1>修改商品分类属性</h1>
	
	<table width="100%" align="center" cellpadding="0" cellspacing="0" class="dl_so">
        <tr>
          <td width="9%" align="center"><img src="/program/admin/index/images/ban_01.gif" /></td>
          <td width="91%" align="left">
				  <h4>提示信息:</h4>
				  <span>当内容类型为单选框或多选框时必须输入属性值，为输入框时可以不输。</span>
          </td>
        </tr>
      </table>

	
	
	
	<form action="/doTradeReg.do" method="post" name="addForm">
	
	
	
	<table width="100%" cellpadding="1" cellspacing="1" border="0" class="listtab">
		
		<tr>
			<td align="right" width="20%">
				分类名称:
			</td>
			<td><%=cat_name%></td>
		</tr>
		
		
		
		<tr>
			<td align="right" width="20%">
				属性名称<font color="red">*</font>				
			</td>
			<td><input name="attr_name" id="attr_name" value="<%=attr_name %>" type="text" maxlength="100" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "/></td>
		</tr>
		<tr>
			<td align="right" width="20%">
				英文名称:
			</td>
			<td><input name="en_name" id="en_name" value="<%=en_name%>" type="text" maxlength="100" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "/></td>
		</tr>
		
		<tr>
			<td align="right" width="20%">
				默认标识:
			</td>
			<td>
				<input name="default_tag" id="default_tag1" type="radio" value="0" <%if(default_tag.equals("0"))out.print("checked");%>/>必填	
				<input name="default_tag" id="default_tag2" type="radio" value="1" <%if(default_tag.equals("1"))out.print("checked");%>/>非必填	
						
			</td>
		</tr>

		<tr>
			<td align="right" width="20%">
				内容类型:
			</td>
			<td>
				<input name="con_type" id="con_type1" type="radio"  value="0" <%if(con_type.equals("0"))out.print("checked");%>/>单选框 
				<input name="con_type" id="con_type2" type="radio"  value="1" <%if(con_type.equals("1"))out.print("checked");%>/>输入框
        <input name="con_type" id="con_type3" type="radio"  value="2" <%if(con_type.equals("2"))out.print("checked");%>/>多选框
				
				</td>
		</tr>

		<tr>
			<td align="right" width="20%">
				显示顺序:
			</td>
			<td><input name="attr_no" size="6" id="attr_no" type="text" onKeyUp="if(!/^[1-9][0-9]*$/.test(this.value))this.value=''" value="<%=attr_no %>" maxlength="4"/></td>
		</tr>

		<tr>
			<td align="right" width="20%">
				属性值:
			</td>
			<td>
				<input name="default_value" id="default_value" type="text" maxlength="100" value="<%=default_value%>" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "/>
				<br/>
		    <font color="#666666">注：当内容类型为单选框或多选框时，属性值可用"|"号隔开！</font>
			</td>
		</tr>
		
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="9682" />
	  		<input type="hidden" name="class_id" value="<%=cat_id%>" />
				<input type="hidden" name="attr_id" value="<%=attr_id%>" />
        <input type="hidden" name="enable_tag" value="0" />
				<input type="submit"  class="buttoncss" name="tradeSub" value="提交" onclick="subForm()" />&nbsp;&nbsp;
				<input type="button"  class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='classAttr.jsp?cat_id=<%=cat_id%>&up_cat_id=<%=up_cat_id%>';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
